package com.scapegoat.pay.account.service.dao.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.scapegoat.pay.account.service.dao.RpAccountHistoryDao;
import org.springframework.stereotype.Repository;
import com.scapegoat.pay.common.core.dao.impl.BaseDaoImpl;
import com.scapegoat.pay.account.service.entity.RpAccountHistory;
import com.scapegoat.pay.account.service.vo.DailyCollectAccountHistoryVo;


/**
 * 账户历史dao实现类
 *
 * @author walkman
 * @date 2017年10月17日 21:21:29
 */
@Repository
public class RpAccountHistoryDaoImpl extends BaseDaoImpl<RpAccountHistory> implements RpAccountHistoryDao {

    public List<RpAccountHistory> listPageByParams(Map<String, Object> params) {
        return this.listBy(params);
    }

    public List<DailyCollectAccountHistoryVo> listDailyCollectAccountHistoryVo(Map<String, Object> params) {
        return this.getSessionTemplate().selectList(getStatement("listDailyCollectAccountHistoryVo"), params);
    }

    @Override
    public RpAccountHistory getByRequestNo(String requestNo) {

        Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("requestNo", requestNo);
        return super.getBy(paramMap);
    }

    /**
     * 更新账户风险预存期外的账户历史记录记为结算完成
     **/
    public void updateCompleteSettTo100(Map<String, Object> params) {
        this.getSessionTemplate().update(getStatement("updateCompleteSettTo100"), params);
    }
}